package ATMAgain;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FindFrame extends JFrame {
    ICodeService service = new CodeServiceImpl();

    public FindFrame(){

        this.setLayout(null);

        JLabel jl = new JLabel("账户余额： "+service.getLoginCode().getMoney()+" 元");
        jl.setBounds(180,80,200,50);
        this.add(jl);

        this.init();

        this.setSize(500,300);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
    }

    private void init(){
        MyButton comeButton = new MyButton("返回",350,200,this);

        comeButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                FindFrame.this.dispose();
                new MainFrame();
            }
        });
    }

}
